#pragma once

#include "Flyweight.h"
#include "..\Definitions.h"
#include "../../SGD Wrappers/SGD_Geometry.h"
#include <string>
#include <list>

class Particle;

class Emitter
{
private:
	std::string sEmitterName;
	std::string sFileName;
	int iMaxParticles;
	float fSpawnRate;
	float fSpawnTime;
	bool bRepeat;
	bool bPlay;
	std::list<Particle*> liveList;
	std::list<Particle*> deadList;

	SGD::Point position;
	SGD::Vector normal;
	Flyweight flyweight;

public:

	Emitter();
	Emitter(const Emitter&);
	~Emitter();

	// Accessors
	const char* GetEmitterName();
	const char* GetFileName();
	int GetMaxParticles();
	float GetSpawnRate();
	float GetSpawnTime();
	bool GetRepeat();
	bool GetPlay();
	SGD::Point GetPosition();
	SGD::Vector GetNormal();
	Flyweight& GetFlyweight();


	// Mutators
	void SetEmitterName(const char* name);
	void SetFileName(const char* name);
	void SetMaxParticles(int num);
	void SetSpawnRate(float time);
	void SetSpawnTime(float time);
	void SetRepeat(bool repeat);
	void SetPlay(bool play);
	void SetPosition(SGD::Point point);
	void SetNormal(SGD::Vector n);

	void Load();
	void Unload();
	void Update(float dt);
	void Render();
};

